<!--
 * @Author: your name
 * @Date: 2021-09-06 16:25:29
 * @LastEditTime: 2021-09-13 16:17:47
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \code\ej-webui-team\src\pages\production\index.vue
-->
<template>
    <div class="node">
        <!-- 表格 -->
        <el-table :data="resData.list" style="width: 100%" size="small">
            <el-table-column type="index" label="序号" align="center"></el-table-column>
            <!-- <el-table-column prop="id" label="日志编号" align="center"></el-table-column> -->
            <el-table-column prop="realname" label="访问人真实姓名" align="center"></el-table-column>
            <el-table-column prop="method" label="访问方式" align="center"></el-table-column>
            <el-table-column prop="content" label="访问路径"></el-table-column>
            <el-table-column label="访问实际" align="center">
                <template v-slot="scope">
                    {{scope.row.logTime | nodeDate}}
                </template>
            </el-table-column>
        </el-table>
          <div class="page">
               <!-- fenye -->
        <!-- <span class="demonstration">完整功能</span> -->
           <el-pagination
              @current-change="pageChangeHandler"
              @size-change="pageSizeChange"
              :current-page="params.page"
               :page-sizes="[2, 5, 10, 15,20]"
              :page-size="params.pageSize"
              layout="total, sizes, prev,  pager, next, jumper"
              :total="resData.total"> 
           </el-pagination>
          </div>
    </div>
</template>
<script>
import request from '@/utils/request'
export default {
    data(){
        return{
            resData:{},
            params:{
                page:1,
                pageSize:10
            }
        }
    },
    methods:{
        // 分页查询产品表格
        async pageQueryLogs(){
            let res=await request.get('/baseLog/pageQuery',{
                params:this.params
            })
            this.resData=res.data
        },
        //page改变事件
        pageChangeHandler(page){
            this.params.page=page;
            this.pageQueryLogs();
        },
        // pagesize改变
        pageSizeChange(pageSize){
            this.params.pageSize=pageSize;
            this.pageQueryLogs();
        }
    },
    created(){
        this.pageQueryLogs();
    }
}
</script>
<style scoped>
.page{
    float: right;
    margin-top: 10px;
}
</style>